#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QDebug>
#include <QColorDialog>
MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);
}

MainWindow::~MainWindow()
{
    delete ui;
}


void MainWindow::on_pushButton_clicked()
{
//    QColorDialog::getColor();
    QColor color = QColorDialog::getColor(QColor(240,240,240),this);
    qDebug() << color;
    // 设置窗口背景颜色
    QString str = "background-color : rgb(" + QString::number(color.red()) + ", " + QString::number(color.green())
            + ", " + QString::number(color.blue()) + ");";
    this->setStyleSheet(str);
}
